package com.xqb.modules.domain.po;

import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xqb.common.annotation.Excel;
import com.xqb.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 订单对象 ord_order
 * 
 * @author xqb
 * @date 2024-10-14
 */
public class OrdOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单id */
    private Long id;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 机构id */
    @Excel(name = "机构id")
    private Long insId;

    /** 交易流水支付单号 */
    @Excel(name = "交易流水支付单号")
    private Long payOrderNo;

    /** 订单状态，1：待支付，2：已支付，3：已关闭，4：已完成，5：已报名，6：已申请退款 */
    @Excel(name = "订单状态，1：待支付，2：已支付，3：已关闭，4：已完成，5：已报名，6：已申请退款")
    private Long status;

    /** 状态备注 */
    @Excel(name = "状态备注")
    private String message;

    /** 订单总金额，单位分 */
    @Excel(name = "订单总金额，单位分")
    private Long totalAmount;

    /** 实付金额，单位分 */
    @Excel(name = "实付金额，单位分")
    private Long realAmount;

    /** 优惠金额，单位分 */
    @Excel(name = "优惠金额，单位分")
    private Long discountAmount;

    /** 支付渠道 */
    @Excel(name = "支付渠道")
    private String payChannel;

    /** 优惠券id */
    @Excel(name = "优惠券id")
    private Long couponId;

    /** 逻辑删除 */
    @TableLogic(value = "0", delval = "1")
    private Long delFlag;

    /** 支付时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /** 订单关闭时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单关闭时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date closeTime;

    /** 订单完成时间，支付后30天 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "订单完成时间，支付后30天", width = 30, dateFormat = "yyyy-MM-dd")
    private Date finishTime;

    /** 申请退款时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "申请退款时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date refundTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setInsId(Long insId) 
    {
        this.insId = insId;
    }

    public Long getInsId() 
    {
        return insId;
    }
    public void setPayOrderNo(Long payOrderNo) 
    {
        this.payOrderNo = payOrderNo;
    }

    public Long getPayOrderNo() 
    {
        return payOrderNo;
    }
    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }
    public void setMessage(String message) 
    {
        this.message = message;
    }

    public String getMessage() 
    {
        return message;
    }
    public void setTotalAmount(Long totalAmount) 
    {
        this.totalAmount = totalAmount;
    }

    public Long getTotalAmount() 
    {
        return totalAmount;
    }
    public void setRealAmount(Long realAmount) 
    {
        this.realAmount = realAmount;
    }

    public Long getRealAmount() 
    {
        return realAmount;
    }
    public void setDiscountAmount(Long discountAmount) 
    {
        this.discountAmount = discountAmount;
    }

    public Long getDiscountAmount() 
    {
        return discountAmount;
    }
    public void setPayChannel(String payChannel) 
    {
        this.payChannel = payChannel;
    }

    public String getPayChannel() 
    {
        return payChannel;
    }
    public void setCouponId(Long couponId) 
    {
        this.couponId = couponId;
    }

    public Long getCouponId() 
    {
        return couponId;
    }
    public void setDelFlag(Long delFlag) 
    {
        this.delFlag = delFlag;
    }

    public Long getDelFlag() 
    {
        return delFlag;
    }
    public void setPayTime(Date payTime) 
    {
        this.payTime = payTime;
    }

    public Date getPayTime() 
    {
        return payTime;
    }
    public void setCloseTime(Date closeTime) 
    {
        this.closeTime = closeTime;
    }

    public Date getCloseTime() 
    {
        return closeTime;
    }
    public void setFinishTime(Date finishTime) 
    {
        this.finishTime = finishTime;
    }

    public Date getFinishTime() 
    {
        return finishTime;
    }
    public void setRefundTime(Date refundTime) 
    {
        this.refundTime = refundTime;
    }

    public Date getRefundTime() 
    {
        return refundTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("insId", getInsId())
            .append("payOrderNo", getPayOrderNo())
            .append("status", getStatus())
            .append("message", getMessage())
            .append("totalAmount", getTotalAmount())
            .append("realAmount", getRealAmount())
            .append("discountAmount", getDiscountAmount())
            .append("payChannel", getPayChannel())
            .append("couponId", getCouponId())
            .append("delFlag", getDelFlag())
            .append("payTime", getPayTime())
            .append("closeTime", getCloseTime())
            .append("finishTime", getFinishTime())
            .append("refundTime", getRefundTime())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .toString();
    }
}
